package main

import "fmt"

func main() {
	pyramid(5)
}

func pyramid(height int) {
	for i := 1; i <= height; i++ {
		defer func(i int) {
			charCount := i*2 - 1
			blankCount := height - i
			var chars string
			var blanks string
			for j := 0; j < blankCount; j++ {
				blanks += " "
			}
			for j := 0; j < charCount; j++ {
				chars += "*"
			}
			fmt.Println(blanks + chars)
		}(i)
	}
}
